import React from 'react'
import { Panel, Cell,CellBody, CellsTitle, CellFooter, Cells } from 'react-weui'

export default class ProductParams extends React.Component {
	constructor(props) {
		super(props)
		this.state = {
			goods: {}
		}
	}
	componentWillReceiveProps(nextProps) {
		if(nextProps.goodData !== undefined) {
			this.setState({
				goods: nextProps.goodData.goods
			})
		}
	}
	render() {
		const { goods } = this.state;
		return (
           <Panel>
                <CellsTitle>商品参数</CellsTitle>
                <Cells style={{ fontSize: '0.9em'}}>
                    <Cell>
	                    <CellBody>品牌</CellBody>
	                    <CellFooter>{goods.brand}</CellFooter>
	                </Cell>
	                <Cell>
	                    <CellBody>上市时间</CellBody>
	                    <CellFooter>{goods.time}</CellFooter>
	                </Cell>
	                <Cell>
	                    <CellBody>分类</CellBody>
	                    <CellFooter>{goods.classId}</CellFooter>
	                </Cell>
	                <Cell>
	                    <CellBody>销售类型</CellBody>
	                    <CellFooter>{goods.type==0?'零售':'批发'}</CellFooter>
	                </Cell>
	                <Cell>
	                    <CellBody>主题</CellBody>
	                    <CellFooter>{goods.theme}</CellFooter>
	                </Cell>
	                 <Cell>
	                    <CellBody>描述</CellBody>
	                    <CellFooter>{goods.description}</CellFooter>
	                </Cell>
	                  <Cell>
	                    <CellBody>风格</CellBody>
	                    <CellFooter>非主流</CellFooter>
	                </Cell>
	                <Cell>
	                    <CellBody>折扣</CellBody>
	                    <CellFooter>{goods.discount * 10}折</CellFooter>
	                </Cell>
	                
                </Cells>

           </Panel>
		);
	}
}
